/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Principal;


import java.awt.event.ItemListener;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.DefaultTableModel;
import javax.swing.JOptionPane;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;

/**
 * @author chivis
 */
public class Paquetes extends javax.swing.JFrame {

    Connection base;
    DefaultTableModel dtm;
    DefaultTableModel dtm2;
    SimpleDateFormat sdf;
    int envio;     //esta variable la envia el jframe paquete_mod_java y contiene el id_paquetes a modificar
    int key; // variable que lleva con sigo la clave primaria de la tabla generada
    paquete_mod_eli actu; //actualaza los registros del jframe paquetes_mod_eli
    int me; // sel ocupa en tabla_producto y es para evitar que salga el mensaje de "inserte la cantidad" varias veses

    // la variable mensaje es el id_paquete de la tabla producto 
    // aqui se decide si es un nuevo registro o se va a modificar uno existente
    public Paquetes(int mensaje, paquete_mod_eli act) {
        initComponents();
        envio = mensaje;
        actu = act;
        me = 0;
        
        try {
            base = (Connection) local_connection.getconnect();
        } catch (SQLException ex) {
            Logger.getLogger(Paquetes.class.getName()).log(Level.SEVERE, null, ex);
        }
       
        dtm = (DefaultTableModel) tabla_producto.getModel(); 
        dtm2 = (DefaultTableModel) tabla_paquete.getModel(); 
        mostrartablaproducto(); 
        text_porcentaje.setEnabled(false);
        text_compra.setEnabled(false);
        text_porcentaje.setDocument(new LimitadorCaracteresFloat ());
        text_compra.setDocument(new LimitadorCaracteresFloat ());

        if (envio != -1) {

            Paquetes_para_modificar();
            try {
                

                PreparedStatement tes = (PreparedStatement) base.prepareStatement("select * from paquetes where id_paquete = ?");
                tes.setInt(1, envio);                
                ResultSet rs = tes.executeQuery();
                rs.next();
                System.out.println(tes.toString());

                box_nom_paq.setText(rs.getString("nombre"));
                inicio_fecha.setDate(rs.getDate("inicio"));
                fin_fecha.setDate(rs.getDate("fin"));
                text_descrip.setText(rs.getString("descripcion"));
                text_porcentaje.setText(rs.getString("porcentaje"));
                text_compra.setText(rs.getString("precio"));

                ResultSet cone = tes.executeQuery();
                cone.next();



            } catch (SQLException ex) {
                Logger.getLogger(Paquetes.class.getName()).log(Level.SEVERE, null, ex);
            }
        } 
    }

    //muestra los todos los productos para que el usuario valla elijiendo
    private void mostrartablaproducto() {
       try { 
           
        PreparedStatement tes = (PreparedStatement)base.prepareStatement("select id_producto, nombre, descripcion, preciocompra from productos where activo = 1");
        ResultSet cone = tes.executeQuery();        
        dtm.setRowCount(0);                 
            ArrayList<Object[]> data = new ArrayList<>();
          while (cone.next()) {
                Object[] rows = new Object[tabla_producto.getColumnCount()];
                for (int i = 0; i < rows.length; i++) {
                    rows[i] = cone.getObject(i + 1);
                }
                data.add(rows);
            }
            for (int i = 0; i < data.size(); i++) {
                dtm.addRow(data.get(i));       
        }
       }        
 catch (SQLException ex) {
            Logger.getLogger(Paquetes.class.getName()).log(Level.SEVERE, null, ex);
        }  
    }

    //inserta los nuevos registros en la tabla de mysql paquetes
    private void paquete_datos() {

        try {
            PreparedStatement tes = (PreparedStatement) base.prepareStatement(" insert into paquetes (nombre, inicio, fin, descripcion, precio, porcentaje, estado) values (?,?,?,?,?,?,?)", Statement.RETURN_GENERATED_KEYS);
            java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
            tes.setString(1, box_nom_paq.getText());           
            if (inicio_fecha.getDate() == null){
                tes.setString(2,"0000-00-00");
            }
            else {
                tes.setString(2, sdf.format(inicio_fecha.getDate()));
            }
            if (fin_fecha.getDate()==null){
                tes.setString(3,"0000-00-00");
            }                                            
            else {
                tes.setString(3, sdf.format(fin_fecha.getDate()));
            }
            
            tes.setString(4, text_descrip.getText());
            if (porcentaje.isSelected()) {               
                tes.setFloat(5, calculo_de_porcentaje());
                tes.setString(6, text_porcentaje.getText());
            } 
            else {               
                tes.setString(5, text_compra.getText());
                tes.setDouble(6, 00.0d);
            }
            if (jr_act.isSelected()==false && jr_inact.isSelected()==false ){
                tes.setString(7,"Activo");                
            }
            else{
                if (jr_act.isSelected()){
                    tes.setString(7,"Activo");                
                }
                else {
                tes.setString(7,"Inactivo");
                }
            }
            tes.execute();
            ResultSet go = tes.getGeneratedKeys();
            go.next();
            key = go.getInt(1);
        } 
        catch (SQLException ex) {
            Logger.getLogger(Paquetes.class.getName()).log(Level.SEVERE, null, ex);

        }

    }

    //inserta los nuevos registros en la tabla de mysql paquetes_producto
    private void paquetes_productos() {
        try {

            PreparedStatement tes = (PreparedStatement) base.prepareStatement(" insert into paquetes_producto (id_paquete, id_producto, cantidad) values (?,?,?)");
            int ro = tabla_paquete.getRowCount();
            for (int i = 0; i < (ro); i++) {
                
                    tes.setString(1, String.valueOf(key));
                    tes.setString(2, String.valueOf(tabla_paquete.getValueAt(i, 0)));

                   

                    if (tabla_paquete.getValueAt(i, 3) == null) {
                        tes.setString(3, String.valueOf(1));
                    } else {
                        tes.setString(3, String.valueOf(tabla_paquete.getValueAt(i, 3)));
                    }


                    tes.execute();
            }
        } 
        catch (SQLException ex) {
            Logger.getLogger(Paquetes.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    //hace el calculo de descuento para la opcion descuento.. :P 
    private float calculo_de_porcentaje() {
        String porc = text_porcentaje.getText();
        float porc2 = Float.parseFloat(porc);
        porc2 = porc2 / 100;
        int row = tabla_paquete.getRowCount();
        float suma = 0;
        for (int i = 0; i < (row); i++) {
            if (tabla_paquete.getValueAt(i, 3) == null) {
                suma = suma + (int) tabla_paquete.getValueAt(i, 2);
               
            } else {

               
                
                float col2 =Float.parseFloat(String.valueOf(tabla_paquete.getValueAt(i, 2)));
                float col3 = Float.parseFloat(String.valueOf(tabla_paquete.getValueAt(i, 3)));
                float mult = col2 * col3;
                suma = suma + mult;
            }
        }
        
        return suma - (suma * porc2);
    }

    //expone el contenido de la tabla tabla_paquete para ser modificada
    //esta informacion se obtiene de la varias tablas de mysql
    private void Paquetes_para_modificar() {
         dtm2.setRowCount(0);       
         
         try {
            PreparedStatement tes = (PreparedStatement) base.prepareStatement("select paquetes_producto.id_producto, productos.nombre, precio,paquetes_producto.cantidad from paquetes_producto join productos on paquetes_producto.id_producto = productos.id_producto join precios on paquetes_producto.id_producto = precios.id_producto where paquetes_producto.id_paquete = ? AND precios.nombre = ? group by paquetes_producto.id_producto");
            tes.setInt(1, envio);
            tes.setString(2, "Unitario");            
            ResultSet cone = tes.executeQuery();
            ArrayList<Object[]> data = new ArrayList<>();
            while (cone.next()) {
                Object[] rows = new Object[tabla_paquete.getColumnCount()];            
                for (int i = 0; i < rows.length; i++) {                    
                   rows[i]= cone.getObject(i + 1);
                }
                data.add(rows);                                
            }
            for (int i = 0; i < data.size(); i++) {               
               dtm2.addRow(data.get(i));
            }
        } catch (SQLException ex) {
            Logger.getLogger(Paquetes.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    // actualiza los  registros de la tabla "paquetes" con la sentencia update de mysql
    private void modificarregistros() {

        try {
            PreparedStatement tes = (PreparedStatement) base.prepareStatement("update paquetes set  nombre = ?, inicio = ?, fin = ?, descripcion = ?,  porcentaje = ?, precio = ?, estado = ? where id_paquete = ? ");
            java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
            tes.setString(1, box_nom_paq.getText());           
            if (inicio_fecha.getDate() == null){
                tes.setString(2,"0000-00-00");
            }
            else {
                tes.setString(2, sdf.format(inicio_fecha.getDate()));
            }
            if (fin_fecha.getDate()==null){
                tes.setString(3,"0000-00-00");
            }                                            
            else {
                tes.setString(3, sdf.format(fin_fecha.getDate()));
            }
            
            tes.setString(4, text_descrip.getText());
            if (porcentaje.isSelected()) {               
                tes.setFloat(6, calculo_de_porcentaje());
                tes.setString(5, text_porcentaje.getText());
            } 
            else {               
                tes.setString(6, text_compra.getText());
                tes.setDouble(5, 00.0d);
            }
            if (jr_act.isSelected()==false && jr_inact.isSelected()==false ){
                tes.setString(7,"Activo");                
            }
            else{
                if (jr_act.isSelected()){
                    tes.setString(7,"Activo");                
                }
                else {
                tes.setString(7,"Inactivo");
                }
            }
            tes.setInt(8,envio);
            tes.execute();
        } catch (SQLException ex) {
            Logger.getLogger(Paquetes.class.getName()).log(Level.SEVERE, null, ex);

        }

    }

    //actualiza los registros de la tabla "paquetes_productos" con la sentencia borrando e insertando en mysql
    private void modificarregistrostabla() {
        try {
            PreparedStatement co = (PreparedStatement) base.prepareStatement("delete from paquetes_producto where id_paquete = ?");
            co.setString(1,String.valueOf(envio));
            co.execute();
            

            PreparedStatement tes = (PreparedStatement) base.prepareStatement("insert into paquetes_producto (id_paquete, id_producto, cantidad) values (?,?,?) ");
            int ro = tabla_paquete.getRowCount();
                
            for (int i = 0; i < (ro); i++) {
                tes.setInt(1, envio);
                tes.setString(2, String.valueOf(tabla_paquete.getValueAt(i, 0)));
                if (tabla_paquete.getValueAt(i, 3) == null){
                    
                    tes.setString(3, String.valueOf(1));   
                }
                else{
                    tes.setString(3, String.valueOf(tabla_paquete.getValueAt(i, 3)));                    
                }
                tes.execute();
            }
            
        } catch (SQLException ex) {
            Logger.getLogger(Paquetes.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    public class LimitadorCaracteresFloat extends PlainDocument {

        /**
         * Método al que llama el editor cada vez que se intenta insertar
         * caracteres. Sólo debemos verificar arg1, que es la cadena que se
         * quiere insertar en el JTextField
         */
        //@Override
        public void insertString(int arg0, String arg1, AttributeSet arg2) throws BadLocationException {
            for (int i = 0; i < arg1.length(); i++) // si no es digit, volvemos
            {
                if (!(Character.isDigit(arg1.charAt(i)) || arg1.charAt(i) == '.')) {
                    return;
                }
            }

            // Si todos son digit, insertamos el texto en el JTextField
            super.insertString(arg0, arg1, arg2);
        }
    }
    //@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jScrollPane4 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jComboBox1 = new javax.swing.JComboBox();
        jScrollPane6 = new javax.swing.JScrollPane();
        jList2 = new javax.swing.JList();
        buttonGroup1 = new javax.swing.ButtonGroup();
        descuento = new javax.swing.ButtonGroup();
        cancelar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        box_nom_paq = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jtext_buscar = new javax.swing.JTextField();
        borrar_producto = new javax.swing.JButton();
        guardar = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        inicio_fecha = new com.toedter.calendar.JDateChooser();
        fin_fecha = new com.toedter.calendar.JDateChooser();
        jScrollPane7 = new javax.swing.JScrollPane();
        text_descrip = new javax.swing.JTextArea();
        jLabel7 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        porcentaje = new javax.swing.JRadioButton();
        cantidad = new javax.swing.JRadioButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tabla_producto = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        text_porcentaje = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        text_compra = new javax.swing.JTextField();
        jScrollPane8 = new javax.swing.JScrollPane();
        tabla_paquete = new javax.swing.JTable();
        jButton2 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jr_act = new javax.swing.JRadioButton();
        jr_inact = new javax.swing.JRadioButton();

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(jTable2);

        jList1.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane4.setViewportView(jList1);

        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jScrollPane5.setViewportView(jTextArea1);

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jList2.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane6.setViewportView(jList2);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("paquetes");

        cancelar.setText("cancelar");
        cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelarActionPerformed(evt);
            }
        });

        jLabel1.setText("Nombre del Paquete");

        box_nom_paq.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                box_nom_paqMouseClicked(evt);
            }
        });
        box_nom_paq.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                box_nom_paqActionPerformed(evt);
            }
        });

        jLabel2.setText("Buscar Producto");

        jtext_buscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtext_buscarActionPerformed(evt);
            }
        });
        jtext_buscar.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtext_buscarKeyReleased(evt);
            }
        });

        borrar_producto.setText("borrar producto");
        borrar_producto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                borrar_productoActionPerformed(evt);
            }
        });

        guardar.setText("Guardar");
        guardar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                guardarMouseClicked(evt);
            }
        });
        guardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                guardarActionPerformed(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel5.setText("Fecha de fin");

        jLabel4.setText("Fecha de inicio");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5)
                    .addComponent(inicio_fecha, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fin_fecha, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(17, 17, 17)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(inicio_fecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(fin_fecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(25, Short.MAX_VALUE))
        );

        text_descrip.setColumns(20);
        text_descrip.setRows(5);
        jScrollPane7.setViewportView(text_descrip);

        jLabel7.setText("Ingresa una Pequeña Descripcion");

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel8.setText("Descuento por:");

        descuento.add(porcentaje);
        porcentaje.setText("Porcentaje");
        porcentaje.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                porcentajeStateChanged(evt);
            }
        });

        descuento.add(cantidad);
        cantidad.setText("Cantidad");
        cantidad.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                cantidadStateChanged(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jLabel8))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(porcentaje)
                            .addComponent(cantidad))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel8)
                .addGap(17, 17, 17)
                .addComponent(porcentaje)
                .addGap(18, 18, 18)
                .addComponent(cantidad)
                .addContainerGap(21, Short.MAX_VALUE))
        );

        tabla_producto.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Codigo", "Nombre", "Descripcion", "Precio Compra"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabla_producto.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabla_productoMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tabla_producto);

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel3.setText("Ingresa el porcentaje de  Descuento");

        text_porcentaje.setToolTipText("");
        text_porcentaje.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                text_porcentajeActionPerformed(evt);
            }
        });

        jLabel6.setText("Igresa el total de Compra");

        text_compra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                text_compraActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(text_porcentaje, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(text_compra, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(text_porcentaje, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(text_compra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(12, 12, 12))
        );

        tabla_paquete.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Codigo", "Nombre", "Precio Venta", "Cantidad"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, true
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabla_paquete.setColumnSelectionAllowed(true);
        tabla_paquete.getTableHeader().setReorderingAllowed(false);
        jScrollPane8.setViewportView(tabla_paquete);
        tabla_paquete.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);

        jButton2.setText("Aceptar");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        buttonGroup1.add(jr_act);
        jr_act.setText("Activo");

        buttonGroup1.add(jr_inact);
        jr_inact.setText("Inactivo");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jr_act, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jr_inact, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addComponent(jr_act)
                .addGap(18, 18, 18)
                .addComponent(jr_inact)
                .addContainerGap(20, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtext_buscar, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(box_nom_paq, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 432, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(30, 30, 30)
                                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 576, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 576, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(layout.createSequentialGroup()
                                    .addComponent(jLabel7)
                                    .addGap(69, 69, 69)
                                    .addComponent(borrar_producto, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(18, 18, 18)
                                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(18, 18, 18)
                                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(10, 10, 10))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(cancelar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(guardar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(box_nom_paq, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtext_buscar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(cancelar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(guardar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton2))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(borrar_producto, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(40, 40, 40)
                                .addComponent(jLabel7)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void cancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelarActionPerformed
        this.dispose();
    }//GEN-LAST:event_cancelarActionPerformed

    private void borrar_productoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_borrar_productoActionPerformed
        DefaultTableModel dtm = (DefaultTableModel) tabla_paquete.getModel();
        if (tabla_paquete.getSelectedRow() != -1) {
            dtm.removeRow(tabla_paquete.getSelectedRow());
        } else {
            JOptionPane.showMessageDialog(this, "No a seleccionado nada a borrar");
        }

    }//GEN-LAST:event_borrar_productoActionPerformed

    private void box_nom_paqActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_box_nom_paqActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_box_nom_paqActionPerformed

    private void jtext_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtext_buscarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtext_buscarActionPerformed

    private void guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_guardarActionPerformed
    }//GEN-LAST:event_guardarActionPerformed

    private void text_porcentajeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_text_porcentajeActionPerformed
        
    }//GEN-LAST:event_text_porcentajeActionPerformed

    private void text_compraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_text_compraActionPerformed
        
    }//GEN-LAST:event_text_compraActionPerformed

    private void box_nom_paqMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_box_nom_paqMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_box_nom_paqMouseClicked

    private void jtext_buscarKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtext_buscarKeyReleased
           //busqueda y mustra los resultados en la tabla producto
            dtm.setRowCount(0);
            String select;
            String consulta;
            String como, where, nombre = "%";
            como = jtext_buscar.getText();
            StringTokenizer tokens = new StringTokenizer(como);
            while (tokens.hasMoreElements()) {
                nombre += (tokens.nextToken() + "%");
            }
            select = "select id_producto, nombre, descripcion, preciocompra from productos where ";
            where = "nombre like '" + nombre + "' or descripcion like '" + nombre + "' or id_producto like '%" + como + "%' AND activo = 1 ";
            consulta = select + where;
            try {               
                PreparedStatement tes = (PreparedStatement)base.prepareStatement(consulta);
                ResultSet cone = tes.executeQuery();
                dtm.setRowCount(0);
                 
                ArrayList<Object[]> data = new ArrayList<>();
                while (cone.next()) {
                    Object[] rows = new Object[tabla_producto.getColumnCount()];
                    for (int i = 0; i < rows.length; i++) {
                        rows[i] = cone.getObject(i + 1);
                    }
                data.add(rows);
            }
        for (int i = 0; i < data.size(); i++) {
                dtm.addRow(data.get(i));        
        }
       }
        
 catch (SQLException ex) {
            Logger.getLogger(Paquetes.class.getName()).log(Level.SEVERE, null, ex);
        }  


    }//GEN-LAST:event_jtext_buscarKeyReleased

    private void guardarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_guardarMouseClicked
           int ro = tabla_paquete.getRowCount();
        if (envio != -1) {
            if (box_nom_paq.getText().equals("") || text_descrip.getText().equals("") ||  ro == 0) {
                JOptionPane.showMessageDialog(this, "Por favor Complete todas los requerimientos ");
            } else {
                if (porcentaje.isSelected()== false && cantidad.isSelected()== false ){
                JOptionPane.showMessageDialog(this, "No ha seleccionado el tipo de descuento");
                }
                else {
                    if (text_porcentaje.getText().equals("") && text_compra.getText().equals("") ){
                         JOptionPane.showMessageDialog(this, "No ha ingresado el porcenteje o la cantidad");
                     }
                    else {
                    modificarregistros();
                    modificarregistrostabla();
                    JOptionPane.showMessageDialog(this, "Se ha Modificado el paquete");
                    box_nom_paq.setText(null);
                    inicio_fecha.setDate(null);
                    fin_fecha.setDate(null);
                    text_descrip.setText(null);
                    text_porcentaje.setText(null);
                    text_compra.setText(null);
                    dtm2.setRowCount(0);
                    } 
                }
            }
        } 
        else {
            if (box_nom_paq.getText().equals("") || text_descrip.getText().equals("") || ro == 0) {
                JOptionPane.showMessageDialog(this, "Por favor complete todos los requerimientos ");
            } 
            else {
                 if (porcentaje.isSelected()== false && cantidad.isSelected()== false ){
                    JOptionPane.showMessageDialog(this, "No ha seleccionado el tipo de descuento");
                 }
                 else{
                     if (text_porcentaje.getText().equals("") && text_compra.getText().equals("") ){
                         JOptionPane.showMessageDialog(this, "No ha ingresado el porcenteje o la cantidad");
                     }
                     else{
                paquete_datos();
                paquetes_productos();
                JOptionPane.showMessageDialog(this, "Se a guardado el paquete");
                box_nom_paq.setText(null);
                inicio_fecha.setDate(null);
                fin_fecha.setDate(null);
                text_descrip.setText(null);
                text_porcentaje.setText(null);
                text_compra.setText(null);
                dtm2.setRowCount(0);
                     }                
                }
            }
        }
        actu.cargar();        
        me = 0;
        envio = -1;

    }//GEN-LAST:event_guardarMouseClicked

    private void tabla_productoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabla_productoMouseClicked
               int row = tabla_producto.getSelectedRow();        
        int contar = tabla_paquete.getRowCount();
        int flag = 0;
        int pro = (int) tabla_producto.getValueAt(row, 0);
        for (int i=0; i < (contar); i++ ){
            int pro2 = Integer.parseInt(String.valueOf(tabla_paquete.getValueAt(i, 0)));
            if (pro == pro2){
                flag = 1;
            }
        }
        if (flag == 1){
        JOptionPane.showMessageDialog(this,"El Producto " + tabla_producto.getValueAt(row, 0) + " ya ha sido agregado");
        }
        else {
            ArrayList<Object[]> data = new ArrayList<>();
            Object[] rows = new Object[tabla_paquete.getColumnCount()];
            try {
                PreparedStatement tes = (PreparedStatement) base.prepareStatement(" select productos.id_producto, productos.nombre, descripcion, precio from productos join precios on productos.id_producto=precios.id_producto where productos.id_producto = ? AND precios.nombre = ? group by productos.id_producto " );
                tes.setString(1, String.valueOf(tabla_producto.getValueAt(row, 0)));
                tes.setString(2, String.valueOf("Unitario"));
                ResultSet rs = tes.executeQuery();
                while (rs.next()) {
                    rows[0] = rs.getString("id_producto");
                    rows[1] = rs.getString("nombre");
                    rows[2] = rs.getInt("precio");
                    data.add(rows);
                    dtm2.addRow(data.get(0));
                }
            } catch (SQLException ex) {
                System.out.println(ex.getMessage());
            }
       
        if (me == 0){
        JOptionPane.showMessageDialog(this,"ingresa la cantidad porfavor");
        me++;
       }
       }

    }//GEN-LAST:event_tabla_productoMouseClicked

    private void porcentajeStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_porcentajeStateChanged
        if (porcentaje.isSelected()) {
            text_compra.setEnabled(false);
        } else {
            text_compra.setEnabled(true);
        }

    }//GEN-LAST:event_porcentajeStateChanged

    private void cantidadStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_cantidadStateChanged
        if (cantidad.isSelected()) {
            text_porcentaje.setEnabled(false);
        } else {
            text_porcentaje.setEnabled(true);
        }
    }//GEN-LAST:event_cantidadStateChanged

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        this.dispose();
        
    }//GEN-LAST:event_jButton2ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("windows".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Paquetes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Paquetes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Paquetes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Paquetes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton borrar_producto;
    private javax.swing.JTextField box_nom_paq;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton cancelar;
    private javax.swing.JRadioButton cantidad;
    private javax.swing.ButtonGroup descuento;
    private com.toedter.calendar.JDateChooser fin_fecha;
    private javax.swing.JButton guardar;
    private com.toedter.calendar.JDateChooser inicio_fecha;
    private javax.swing.JButton jButton2;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JList jList1;
    private javax.swing.JList jList2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JTable jTable2;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JRadioButton jr_act;
    private javax.swing.JRadioButton jr_inact;
    private javax.swing.JTextField jtext_buscar;
    private javax.swing.JRadioButton porcentaje;
    private javax.swing.JTable tabla_paquete;
    private javax.swing.JTable tabla_producto;
    private javax.swing.JTextField text_compra;
    private javax.swing.JTextArea text_descrip;
    private javax.swing.JTextField text_porcentaje;
    // End of variables declaration//GEN-END:variables
}
